Return to doc.sitecore.com

  Html
Prev Next

Note : this field type is present in Sitecore 5.3 for backward compatibility. Users should use the Rich Text field type for HTML formatted text. This field type cannot be created in template builder – it can only be set for an existing field.

Client view:

Creates a field that contains HTML.

The HTML can be edited using the Rich Text editor.   

/upload/sdn5/reference/field reference/standard data types/html1.png  

/upload/sdn5/reference/field reference/standard data types/html2.png

Valid default value:

Any html formatted text or plain text.

Source:

You can use the source field to specify Rich Text Editor profiles. Profiles are used to define the toolbars, buttons and drop-down menus of the Editor.   

Rich Text Editor profiles are stored in System/Settings/Html Editor Profilesfolder.

You can create your own profile and bind it to an Html field:

  1. Go to System/Settings/Html Editor Profiles:
    /upload/sdn5/reference/field reference/standard data types/html3.png
  2. Create your custom profile and remove the Items you don't want to be displayed:
    /upload/sdn5/reference/field reference/standard data types/html4.png
  3. Open a Template in the Template Editor, create Html field and fill in the Source field. The Source should point to your custom profile:
    /upload/sdn5/reference/field reference/standard data types/html5.jpg

    Save the Template.

  4. Use the Template you've just edited to create a new Item in the Content Editor. The Item will contain an html field.
    Click on the Zoom button of this field and you will see only two toolbars displayed:
    /upload/sdn5/reference/field reference/standard data types/html6.png

    You can also remove/add the buttons or populate the drop-down menus in the same manner.

For information about accessing the field values programmatically, please follow the links below:

Accessing Html field value in C#

Accessing Html field value in XSLT   


Prev Next